import { event_id } from "../orc/orc_declare/declare_data";

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Sprite)
    bg_roll: cc.Sprite = null;

    material:cc.Material;
    x:number;
    y:number;
    // LIFE-CYCLE CALLBACKS:

    // onLoad () {}

    start () {
        //this.material = this.bg_roll.sharedMaterials[0];
        this.material = this.bg_roll.getMaterials()[0];
        this.x =0.0;
        this.y =0.0;
    }

    

    btn_test(e,u){
        if(u == 'x')
        {
           this.x += 0.1;
           this.material.setProperty('x_pos',this.x);
        }
        else if(u == 'y')
        {
            this.y += 0.1;
            this.material.setProperty('y_pos',this.y);
        }
        else if(u == 'xy')
        {
            this.x += 0.1;
            this.y += 0.1;
            this.material.setProperty('x_pos',this.x);
            this.material.setProperty('y_pos',this.y);
        }
        
    }

    // update (dt) {}
}
